package tg.app.rj.payreqw.virtual;

import java.rmi.RemoteException;
import psdi.app.common.virtual.ChangeStatusSet;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.mbo.NonPersistentMboSetRemote;
import psdi.mbo.SqlFormat;
import psdi.util.MXException;
import tg.app.rj.payreqw.Payreqww;

/***
 * @author pzx
 * 
 */
public class PayreqwwChangeStatusSet extends ChangeStatusSet implements
		NonPersistentMboSetRemote {
	private static final long serialVersionUID = 1L;

	public PayreqwwChangeStatusSet(MboServerInterface ms) throws MXException,
			RemoteException {
		super(ms);
	}

	protected Mbo getMboInstance(MboSet ms) throws MXException, RemoteException {
		return new PayreqwwChangeStatus(ms);
	}

	protected MboSetRemote getMboIntoSet(MboRemote mbo) throws MXException,
			RemoteException {
		MboSetRemote changeFVSet = getMboServer().getMboSet(mbo.getName(),getUserInfo());
		String sql = "PAYREQWWID=:PAYREQWWID";
		SqlFormat sqf = new SqlFormat(mbo, sql);
		changeFVSet.setWhere(sqf.format());
		return changeFVSet;
	}

	protected void changeMboStatus(MboRemote payreqww, MboRemote param)
			throws MXException, RemoteException {
		((Payreqww) payreqww).changeStatus(param.getString("status"),param.getDate("statdate"), param.getString("memo"));
	}
}